revealer: Measure child widget size using gtk_widget_measure
authorTimm Bäder <mail@baedert.org>
Thu, 1 Dec 2016 18:33:38 +0000 (19:33 +0100)
committerTimm Bäder <mail@baedert.org>
Sun, 4 Dec 2016 11:00:46 +0000 (12:00 +0100)
gtk/gtkrevealer.c

index c9e76938246cfe6aff36fd9af0d5276cb1d7e379..e42be2e37bda4ebe17e7c15233b099a2585f2bce 100644 (file)
@@ -316,11 +316,13 @@ gtk_revealer_get_child_allocation (GtkRevealer   *revealer,
       transition = effective_transition (revealer);
       if (transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT ||
           transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT)
-        gtk_widget_get_preferred_width_for_height (child, MAX (0, allocation->height - vertical_padding), NULL,
-                                                   &child_allocation->width);
+        gtk_widget_measure (child, GTK_ORIENTATION_HORIZONTAL,
+                            MAX (0, allocation->height - vertical_padding),
+                            NULL, &child_allocation->width, NULL, NULL);
       else
-        gtk_widget_get_preferred_height_for_width (child, MAX (0, allocation->width - horizontal_padding), NULL,
-                                                   &child_allocation->height);
+        gtk_widget_measure (child, GTK_ORIENTATION_VERTICAL,
+                            MAX (0, allocation->width - horizontal_padding),
+                            NULL, &child_allocation->height, NULL, NULL);
     }
 
   child_allocation->width = MAX (child_allocation->width, allocation->width - horizontal_padding);